from django.contrib import admin

# Register your models here.
from .models import City, IDC, Host


class CityAdmin(admin.ModelAdmin):
    list_display = ('name',)
    search_fields = ('name',)  # 添加搜索框，按name搜索


class IDCAdmin(admin.ModelAdmin):
    list_display = ('name', 'city')
    search_fields = ('name', 'city')


class HostAdmin(admin.ModelAdmin):
    list_display = ('hostname', 'ip', 'idc')
    search_fields = ('hostname', 'ip', 'idc')


admin.site.register(City, CityAdmin)
admin.site.register(IDC, IDCAdmin)
admin.site.register(Host, HostAdmin)
